<template>
	<el-radio-group v-model="selected" @change="onchange">
		<el-radio v-for="item in items" :label="item.id" :key="item.id">{{item.name}}</el-radio>
	</el-radio-group>
</template>

<script>
	import _categories from "@/common/categories";

	export default {
		props: ["value"],
		watch: {
			value() {
				this.selected = this.value;
			},
		},
		data() {
			return {
				items: _categories.semesters,
				selected: this.value,
			};
		},
		methods: {
			onchange(value) {
				this.$emit("input", value);
			},
		},
	};
</script>

<style>
</style>
